var app = angular.module("login", [ "ngCookies", "constApp" ]);
app.controller("loginContraller", function($scope, $http, $cookieStore,
                                               $templateCache,$const) {
    if(!$cookieStore.get("settingPassword")){
        location.href="login.html"
    }
    $scope.settingPassword=function(){
        var param={};
        param["phone"]=$cookieStore.get("phone");
        param["password"]=$scope.password;
        if($scope.password!=$scope.newPassword){
            alert("密码不一致")
            return false;
        }
        $http({
            url : URL+'oltuservice/stting/password' ,
            method : 'POST' ,
            dataType : "json" ,
            params : { phone : $cookieStore.get("phone"),password:$scope.password}
        }).success(function(data ){
                location.href="login.html"
            }
        )
    }
})

